ci: Add the backend to the reports
authorMatthias Clasen <mclasen@redhat.com>
Fri, 15 May 2020 23:49:18 +0000 (19:49 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 15 May 2020 23:49:18 +0000 (19:49 -0400)
We want the test names in the junit xml to be
unique across all the tests in a job, so we need
to include the backend in the test name.

And we also want to see the used backend in
the html report.

.gitlab-ci/meson-html-report.py
.gitlab-ci/meson-junit-report.py
.gitlab-ci/run-tests.sh

index d670f41362eb6f4652c0aa45b35b4dfddefe535a..2d67553fe5765b103cc66f62e2d204660ebead93 100755 (executable)
@@ -138,12 +138,13 @@ ul.images li {
 </head>
 <body>
   <header>
-    <h1>{{ report.project_name }}/{{ report.branch_name }} :: Test Reports</h1>
+    <h1>{{ report.project_name }}/{{ report.backend }}/{{ report.branch_name }} :: Test Reports</h1>
   </header>
 
   <article>
     <section>
       <div class="report-meta">
+        <p><strong>Backend:</strong> {{ report.backend }}</p>
         <p><strong>Branch:</strong> {{ report.branch_name }}</p>
         <p><strong>Date:</strong> <time datetime="{{ report.date.isoformat() }}">{{ report.locale_date }}</time></p>
         {% if report.job_id %}<p><strong>Job ID:</strong> {{ report.job_id }}</p>{% endif %}
@@ -259,6 +260,9 @@ aparser = argparse.ArgumentParser(description='Turns a Meson test log into an HT
 aparser.add_argument('--project-name', metavar='NAME',
                      help='The project name',
                      default='Unknown')
+aparser.add_argument('--backend', metavar='NAME',
+                     help='The used backend',
+                     default='unknown')
 aparser.add_argument('--job-id', metavar='ID',
                      help='The job ID for the report',
                      default=None)
@@ -319,6 +323,7 @@ report = {}
 report['date'] = datetime.datetime.utcnow()
 report['locale_date'] = report['date'].strftime("%c")
 report['project_name'] = args.project_name
+report['backend'] = args.backend
 report['job_id'] = args.job_id
 report['branch_name'] = args.branch
 report['total_successes'] = 0
index dd0b13897c9b7eaa9dc80a094cf5560b950e17d9..532305cdca4575b06b8ac3ac2103572c78499c45 100755 (executable)
@@ -19,6 +19,9 @@ aparser = argparse.ArgumentParser(description='Turns a Meson test log into a JUn
 aparser.add_argument('--project-name', metavar='NAME',
                      help='The project name',
                      default='unknown')
+aparser.add_argument('--backend', metavar='NAME',
+                     help='The used backend',
+                     default='unknown')
 aparser.add_argument('--job-id', metavar='ID',
                      help='The job ID for the report',
                      default='Unknown')
@@ -92,18 +95,18 @@ for name, units in suites.items():
     for unit in successes:
         testcase = ET.SubElement(testsuite, 'testcase')
         testcase.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
-        testcase.set('name', unit['name'])
+        testcase.set('name', '{}/{}'.format(args.backend, unit['name']))
         testcase.set('time', str(unit['duration']))
 
     for unit in failures:
         testcase = ET.SubElement(testsuite, 'testcase')
         testcase.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
-        testcase.set('name', unit['name'])
+        testcase.set('name', '{}/{}'.format(args.backend, unit['name']))
         testcase.set('time', str(unit['duration']))
 
         failure = ET.SubElement(testcase, 'failure')
         failure.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
-        failure.set('name', unit['name'])
+        testcase.set('name', '{}/{}'.format(args.backend, unit['name']))
         failure.set('type', 'error')
         failure.text = unit['stdout']
 
index e259ec5bd26a10b35801f45d7632015d720c75ac..b8c61cecb71f01caff7d1f2adf927d6826f3c4a6 100755 (executable)
@@ -61,11 +61,13 @@ cd ${builddir}
 
 $srcdir/.gitlab-ci/meson-junit-report.py \
         --project-name=gtk \
+        --backend=${backend} \
         --job-id="${CI_JOB_NAME}" \
         --output=report-${backend}.xml \
         meson-logs/testlog-${backend}.json
 $srcdir/.gitlab-ci/meson-html-report.py \
         --project-name=gtk \
+        --backend=${backend} \
         --job-id="${CI_JOB_NAME}" \
         --reftest-output-dir="testsuite/reftests/output/${backend}" \
         --output=report-${backend}.html \